/*
 * @Author: daidai
 * @Date: 2022-01-12 14:22:29
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-04-28 14:53:02
 * @FilePath: \web-pc\src\pages\big-screen\router\index.js
 */
import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
    // redirect: "/launch",
  },
  {
    path: "/layout",
    name: "Layout",
    component: () =>
      import(/* webpackChunkName: "LSD.bighome" */ "../views/layout.vue"),
    redirect: "/layout/index",
    children: [
      {
        path: "/layout/index",
        name: "layout_index",
        component: () =>
          import(
            /* webpackChunkName: "LSD.bighome" */ "../views/layout/index.vue"
          ),
      },
    ],
  },
  {
    path: "/launch",
    name: "Launch",
    component: () =>
      import(/* webpackChunkName: "LSD.launch" */ "../views/launch.vue"),
    redirect: "/launch/index",
    children: [
      {
        path: "/launch/index",
        name: "launch_home",
        component: () =>
          import(
            /* webpackChunkName: "LSD.launch" */ "../views/home/index.vue"
          ),
      },
      {
        path: "/launch/inout",
        name: "launch_inout",
        component: () =>
          import(
            /* webpackChunkName: "LSD.launch" */ "../views/inout/index.vue"
          ),
      },
      {
        path: "/launch/internet",
        name: "launch_internet",
        component: () =>
          import(
            /* webpackChunkName: "LSD.launch" */ "../views/internet/index.vue"
          ),
      },
      {
        path: "/launch/car",
        name: "launch_car",
        component: () =>
          import(/* webpackChunkName: "LSD.launch" */ "../views/car/index.vue"),
      },
      {
        path: "/launch/pack",
        name: "launch_pack",
        component: () =>
          import(
            /* webpackChunkName: "LSD.launch" */ "../views/pack/index.vue"
          ),
      },
      // {
      //   path: "/launch/pack00",
      //   name: "launch_pack00",
      //   component: () =>
      //     import(
      //       /* webpackChunkName: "LSD.launch" */ "../views/pack00/index.vue"
      //     ),
      // },
      // {
      //   path: "/launch/avatorGT",
      //   name: "launch_avator",
      //   component: () =>
      //     import(
      //       /* webpackChunkName: "LSD.launch" */ "../views/avatorGT/index.vue"
      //     ),
      // },
      {
        path: "/launch/avator",
        name: "launch_avator",
        component: () =>
          import(
            /* webpackChunkName: "LSD.launch" */ "../views/avator/index.vue"
          ),
      },
    ],
  },
  {
    path: "/login",
    name: "login",
    component: () =>
      import(/* webpackChunkName: "LSD.bighome" */ "../views/login.vue"),
  },
  {
    path: "/index",
    name: "index",
    component: () =>
      import(/* webpackChunkName: "LSD.bighome" */ "../views/index.vue"),
  },
];
const router = new VueRouter({
  mode: "hash",
  // base: process.env.BASE_URL,
  routes,
});

// //路由拦截
// router.beforeEach((to, from, next) => {

//   if (webStorage.ls.get(ACCESS_TOKEN)) {
//     if (to.path === LOGIN_PAGE_PATH) {
//       next({ path: HOME_PAGE_PATH })
//     } else {
//       next()
//     }
//     NProgress.done()
//   } else {
//     if (ACCESS_WHITE_LIST.find((item) => item == to.path)) {
//       //白名单不校验token，放行
//       next()
//     } else {
//       next({ path: LOGIN_PAGE_PATH, query: { redirect: to.fullPath } })
//     }
//     NProgress.done()
//   }
// })

export default router;
